package com.example.users.controller;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.users.vo.R;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

import java.io.Serializable;
import java.util.List;

import com.example.users.entity.User;
import com.example.users.service.UserService;

/**
 * (User)表控制层
 *
 * @author 全哥哥
 * @since 2025-05-13 10:38:08
 */
@RestController
@RequestMapping("user")
public class UserController {
    /**
     * 服务对象
     */
    @Resource
    private UserService userService;


    @GetMapping
    public R selectAll() {
        return R.success(userService.list());
    }

    @GetMapping("{id}")
    public User selectOne(@PathVariable("id") Serializable id) {
        return userService.getById(id);
    }

}

